<?php
namespace Admin\Controller;
use Admin\Controller\BaseController;
class PracticesController extends BaseController {
	private $tbl;
	public function _initialize(){
		$this->tbl='practices';
		$this->model=D($this->tbl);
		parent::_initialize();
	}
    public function index(){
		parent::index($this->tbl,"yjl_check","1");
    }
	public function ulist(){
		parent::index($this->tbl,"yjl_check","0");
	}
	public function	view(){
		$id=I('get.id');//获取id
	}
	public function mod(){//修改界面
		 parent::mod($this->tbl,"yjl_id");
	}
	public function update(){//修改
		parent::update($this->tbl,"yjl_logo");
	}
	public function delete(){//删除
		parent::delete($this->tbl,"yjl_id","yjl_photo");
	}
	public function form(){//添加界面
		parent::form($this->tbl);
	}
	public function add(){//添加
		parent::add($this->tbl,"yjl_pfile","1");
	}
	public function search(){
		parent::search($this->tbl,"yjl_name");
	}
	public function	show(){//详细信息
		$id=I('get.id');//获取id--详细信息
		
		//点击量加一
		$this->model->where("yjl_id = '{$id}'")->setInc('yjl_hit');

		$data=$this->model->where("yjl_id='{$id}'")->find();
		$this->assign("firblock",$data);
			
		//社团名称
		$sql="select * from yjl_groups where yjl_id='{$id}'";
		$data2=M()->query($sql);
		$this->assign("lem",$data2);//社团和发布者名称
		//已报名人员
			$sql="select * from yjl_users where yjl_stunum in (
			select yjl_stunum from yjl_stuprac where yjl_pid='{$id}')";
			$data1=M()->query($sql);
			$this->assign("secblock",$data1);
		$this->display();
	}
	public function pass(){//通过审核
		parent::pass($this->tbl);
	}
}